var util = require('../../utils/util.js');
var ajax = require('../../utils/ajax.js');

Page({
	data: {
		dataLoaded: false,
		shopInfo: {},
		userList: [],
	},

	onShareAppMessage: function() {
		return {
			title: app.config.shareTitle,
			path: "/pages/fanliList/fanliList?shopId=" + this.shopId
		}
	},

	onLoad(options) {
		var _self = this;

		_self.shopId = options.shopId;

		_self._getPageData();
	},

	_toPay() {
		wx.navigateTo({
			url: '/pages/pay/pay?shopId=' + this.shopId
		});
	},


	_getPageData() {
		var _self = this;

		ajax.P('/openapi/User/getQueuePeople', {
			shopId: _self.shopId
		}, function(d) {

			_self.setData({
				dataLoaded: true,
				shopInfo: d.result['shopInfo'],
				userList: d.result['userList'] || [],
			});


		});

	},
});